package com.gsafety.wellsfort.common.util;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;

public class TokenUtil {

    public static String getTokenKey(){
        String tokenKey = getRequest().getHeader("signature");
        return tokenKey;
    }

    public static HttpServletRequest getRequest()
    {
        ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();

        HttpServletRequest request = requestAttributes.getRequest();

        return request;
    }

}
